//
//  DataSummaryADCell.swift
//  TimeBoat
//
//  Created by bo wang on 2022/8/24.
//  Copyright © 2022 Time Boat. All rights reserved.
//

import UIKit
import SDWebImage

class DataSummaryADCell: DataSummaryCell {
    
    @IBOutlet var adImageView: UIImageView!
    
    override func update(vm: DataSummaryCellViewModel, data: Any?) {
        super.update(vm: vm, data: data)

        guard let data = data as? SummaryADDataModel else { return }
        
        if let urlStr = data.adUrl {
            adImageView.sd_setImage(with: URL(string: urlStr))
        } else {
            adImageView.image = nil
        }
    }
}
